<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
            $table->id();
            $table->string('serial_number', 32)->comment('流水号');
            $table->integer('user_id')->comment('用户ID');
            $table->string('province')->comment('省code');
            $table->string('city')->comment('市code');
            $table->string('district')->comment('区code');
            $table->string('street')->comment('街道');
            $table->string('home')->comment('详细楼层及门牌号');
            $table->string('phone')->comment('联系电话');
            $table->string('name')->comment('联系人');
            // 0:支付中 1:支付完成 2：安排服务中 3:已安排服务 4：已完成服务 -1:已取消(需退款) -2：已取消(无需退款)
            $table->tinyInteger('status')->default(0)->comment('订单状态');
            $table->string('remark')->nullable()->comment('订单备注');
            $table->integer('operate_user_id')->default(0)->comment('运营人员');
            $table->string('operate_remark')->nullable()->comment('运营备注');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('orders');
    }
}
